{ ***  cef_trace_capi.h  *** }

    PCefTraceClient = ^TCefTraceClient;
    PCEFEndTracingCallback = ^TCEFEndTracingCallback;

    // Implement this structure to receive notification when tracing has completed.
    // The functions of this structure will be called on the browser process UI
    // thread.
    TCEFEndTracingCallback = record
        // Base structure.
        base: TCefBase;

        // Called after all processes have sent their trace data. |tracing_file| is
        // the path at which tracing data was written. The client is responsible for
        // deleting |tracing_file|.
        on_end_tracing_complete: procedure(
            self: PCEFEndTracingCallback;
            const tracing_file:PCefString); cconv;
    end;


    // Implement this structure to receive trace notifications. The functions of
    // this structure will be called on the browser process UI thread.
    TCefTraceClient = record
        // Base structure.
        base: TCefBase;

        // Called 0 or more times between CefBeginTracing and OnEndTracingComplete
        // with a UTF8 JSON |fragment| of the specified |fragment_size|. Do not keep a
        // reference to |fragment|.
        on_trace_data_collected: procedure(self: PCefTraceClient;
            const fragment: PAnsiChar; fragment_size: csize_t); cconv;

        // Called in response to CefGetTraceBufferPercentFullAsync.
        on_trace_buffer_percent_full_reply: procedure(self: PCefTraceClient; percent_full: Single); cconv;

        // Called after all processes have sent their trace data.
        on_end_tracing_complete: procedure(self: PCefTraceClient); cconv;
    end;

    // Start tracing events on all processes. Tracing is initialized asynchronously
    // and |callback| will be executed on the UI thread after initialization is
    // complete.
    //
    // If CefBeginTracing was called previously, or if a CefEndTracingAsync call is
    // pending, CefBeginTracing will fail and return false (0).
    //
    // |categories| is a comma-delimited list of category wildcards. A category can
    // have an optional '-' prefix to make it an excluded category. Having both
    // included and excluded categories in the same list is not supported.
    //
    // Example: "test_MyTest*" Example: "test_MyTest*,test_OtherStuff" Example:
    // "-excluded_category1,-excluded_category2"
    //
    // This function must be called on the browser process UI thread.
    tfn_cef_begin_tracing = function(
        const categories: PCefString;
        callback: PCefCompletionCallback): Integer; cdecl;

    // Stop tracing events on all processes.
    //
    // This function will fail and return false (0) if a previous call to
    // CefEndTracingAsync is already pending or if CefBeginTracing was not called.
    //
    // |tracing_file| is the path at which tracing data will be written and
    // |callback| is the callback that will be executed once all processes have sent
    // their trace data. If |tracing_file| is NULL a new temporary file path will be
    // used. If |callback| is NULL no trace data will be written.
    //
    // This function must be called on the browser process UI thread.
    tfn_cef_end_tracing = function(
        const tracing_file: PCefString;
        callback: PCEFEndTracingCallback): Integer; cdecl;

    // Returns the current system trace time or, if none is defined, the current
    // high-res time. Can be used by clients to synchronize with the time
    // information in trace events.
    tfn_cef_now_from_system_trace_time = function: Int64; cdecl;

